; Music of Hurlements (1988) (Ubi Soft)
; Ripped by Megachur the 24/03/2009

; Need System Vectors

	write "HURLEMEN.BIN"

music_date_rip	equ &1839
music_adr	equ &9000
first_theme	equ 0
last_theme	equ 0	; 0 -> 0

	read "music_header_v1_0.asm"

.l9000
	db #81,#01,#0f,#ff,#03,#81,#04,#0f
	db #ff,#04,#81,#03,#0f,#ff,#04,#81
	db #02,#0f,#ff,#02,#92,#81,#01,#03
	db #02,#01,#fd,#02,#a1,#00,#11,#a2
	db #00,#2f,#a3,#00,#3f,#a4,#00,#4f
	db #b7,#b3,#04,#31,#31,#08,#20,#2a
	db #00,#20,#00,#1c,#19,#08,#80,#21
	db #38,#04,#20,#0c,#19,#04,#80,#21
	db #39,#04,#20,#0c,#19,#04,#80,#21
	db #38,#08,#20,#0c,#25,#04,#80,#04
	db #19,#04,#80,#21,#31,#08,#20,#0c
	db #19,#04,#80,#04,#25,#04,#80,#31
	db #34,#08,#20,#2a,#00,#20,#00,#1c
	db #1c,#08,#80,#21,#3b,#08,#20,#0c
	db #1c,#04,#80,#04,#28,#08,#80,#01
	db #3a,#08,#20,#04,#28,#04,#80,#21
	db #34,#08,#20,#0c,#28,#04,#80,#04
	db #28,#04,#80,#31,#33,#08,#20,#2a
	db #00,#20,#00,#1c,#1b,#08,#80,#21
	db #38,#04,#20,#0c,#1b,#04,#80,#21
	db #39,#04,#20,#0c,#1b,#04,#80,#21
	db #38,#08,#20,#0c,#27,#04,#80,#04
	db #1b,#04,#80,#21,#33,#08,#20,#0c
	db #1b,#04,#80,#04,#27,#04,#80,#31
	db #32,#08,#20,#2a,#00,#20,#00,#1c
	db #1a,#08,#80,#21,#36,#04,#20,#0c
	db #1a,#04,#80,#21,#39,#04,#20,#0c
	db #26,#08,#80,#01,#36,#08,#20,#04
	db #26,#04,#80,#21,#32,#08,#20,#0c
	db #1a,#04,#80,#04,#26,#04,#80,#31
	db #31,#08,#20,#2a,#00,#20,#00,#1c
	db #19,#08,#80,#21,#38,#04,#20,#0c
	db #19,#04,#80,#21,#39,#04,#20,#0c
	db #19,#04,#80,#21,#38,#08,#20,#0c
	db #25,#04,#80,#04,#19,#04,#80,#21
	db #31,#08,#20,#0c,#19,#04,#80,#04
	db #25,#04,#80,#31,#34,#08,#20,#2a
	db #00,#20,#00,#1c,#1c,#08,#80,#21
	db #3b,#08,#20,#0c,#1c,#04,#80,#04
	db #28,#08,#80,#01,#3a,#08,#20,#04
	db #28,#04,#80,#21,#34,#08,#20,#0c
	db #28,#04,#80,#04,#28,#04,#80,#31
	db #33,#08,#20,#2a,#00,#20,#00,#1c
	db #1b,#08,#80,#21,#38,#04,#20,#0c
	db #1b,#04,#80,#21,#39,#04,#20,#0c
	db #1b,#04,#80,#21,#38,#08,#20,#0c
	db #27,#04,#80,#04,#1b,#04,#80,#21
	db #33,#08,#20,#0c,#1b,#04,#80,#04
	db #27,#04,#80,#31,#32,#08,#20,#2a
	db #00,#10,#00,#1c,#1a,#08,#80,#21
	db #36,#04,#20,#0c,#1a,#04,#80,#21
	db #39,#04,#20,#0c,#26,#08,#80,#11
	db #36,#08,#20,#0a,#00,#04,#00,#22
	db #38,#04,#48,#14,#26,#04,#80,#31
	db #32,#08,#20,#2a,#38,#04,#48,#1c
	db #1a,#04,#80,#22,#00,#04,#48,#14
	db #26,#04,#80,#31,#31,#08,#20,#2a
	db #00,#08,#6f,#1c,#19,#08,#80,#31
	db #38,#04,#20,#2a,#00,#04,#45,#1c
	db #19,#04,#80,#31,#39,#04,#20,#2a
	db #00,#04,#45,#1c,#19,#04,#80,#31
	db #38,#08,#20,#2a,#00,#08,#68,#1c
	db #25,#04,#80,#04,#19,#04,#80,#31
	db #31,#08,#20,#2a,#00,#04,#45,#1c
	db #19,#04,#80,#22,#00,#04,#45,#14
	db #25,#04,#80,#31,#34,#08,#20,#2a
	db #00,#08,#68,#1c,#1c,#08,#80,#31
	db #3b,#08,#20,#2a,#00,#04,#45,#1c
	db #1c,#04,#80,#22,#00,#04,#45,#14
	db #28,#08,#80,#11,#3a,#08,#20,#0a
	db #00,#04,#48,#22,#00,#04,#45,#14
	db #28,#04,#80,#31,#34,#08,#20,#2a
	db #00,#04,#45,#1c,#28,#04,#80,#22
	db #00,#04,#45,#14,#28,#04,#80,#31
	db #33,#08,#20,#2a,#00,#08,#68,#1c
	db #1b,#08,#80,#31,#38,#04,#20,#2a
	db #00,#04,#45,#1c,#1b,#04,#80,#31
	db #39,#04,#20,#2a,#00,#04,#45,#1c
	db #1b,#04,#80,#31,#38,#08,#20,#2a
	db #00,#08,#68,#1c,#27,#04,#80,#04
	db #1b,#04,#80,#31,#33,#08,#20,#2a
	db #00,#04,#45,#1c,#1b,#04,#80,#22
	db #00,#04,#45,#14,#27,#04,#80,#31
	db #32,#08,#20,#2a,#00,#08,#6f,#1c
	db #1a,#08,#80,#31,#36,#04,#20,#2a
	db #00,#04,#45,#1c,#1a,#04,#80,#31
	db #39,#04,#20,#2a,#00,#04,#45,#1c
	db #26,#08,#80,#11,#36,#08,#20,#0a
	db #00,#04,#48,#22,#00,#08,#63,#14
	db #26,#04,#80,#21,#32,#08,#20,#0c
	db #1a,#04,#80,#22,#00,#04,#45,#14
	db #26,#04,#80,#31,#31,#08,#20,#2a
	db #00,#08,#6f,#1c,#19,#08,#80,#31
	db #38,#04,#20,#2a,#00,#04,#45,#1c
	db #19,#04,#80,#31,#39,#04,#20,#2a
	db #00,#04,#45,#1c,#19,#04,#80,#31
	db #38,#08,#20,#2a,#00,#08,#68,#1c
	db #25,#04,#80,#04,#19,#04,#80,#31
	db #31,#08,#20,#2a,#00,#04,#45,#1c
	db #19,#04,#80,#22,#00,#04,#45,#14
	db #25,#04,#80,#31,#34,#08,#20,#2a
	db #00,#08,#6f,#1c,#1c,#08,#80,#31
	db #3b,#08,#20,#2a,#00,#04,#45,#1c
	db #1c,#04,#80,#22,#00,#04,#45,#14
	db #28,#08,#80,#11,#3a,#08,#20,#0a
	db #00,#04,#48,#22,#00,#04,#42,#14
	db #28,#04,#80,#31,#34,#08,#20,#2a
	db #00,#04,#45,#1c,#28,#04,#80,#22
	db #00,#04,#45,#14,#28,#04,#80,#31
	db #33,#08,#20,#2a,#00,#08,#6f,#1c
	db #1b,#08,#80,#31,#38,#04,#20,#2a
	db #00,#04,#45,#1c,#1b,#04,#80,#31
	db #39,#04,#20,#2a,#00,#04,#45,#1c
	db #1b,#04,#80,#31,#38,#08,#20,#2a
	db #00,#08,#68,#1c,#27,#04,#80,#04
	db #1b,#04,#80,#31,#33,#08,#20,#2a
	db #00,#04,#45,#1c,#1b,#04,#80,#22
	db #00,#04,#45,#14,#27,#04,#80,#31
	db #32,#08,#20,#2a,#00,#08,#4f,#1c
	db #1a,#08,#80,#31,#36,#04,#20,#2a
	db #00,#04,#45,#1c,#1a,#04,#80,#31
	db #39,#04,#20,#2a,#00,#04,#45,#1c
	db #26,#08,#80,#11,#36,#08,#20,#0a
	db #00,#04,#48,#22,#00,#08,#63,#14
	db #26,#04,#80,#21,#32,#08,#20,#0c
	db #1a,#04,#80,#22,#00,#04,#45,#14
	db #26,#04,#80,#31,#31,#08,#20,#2a
	db #00,#04,#4f,#1c,#19,#08,#80,#02
	db #00,#04,#4f,#31,#31,#04,#20,#2a
	db #00,#04,#4f,#1c,#19,#04,#80,#31
	db #3d,#08,#20,#2a,#00,#04,#4f,#1c
	db #19,#04,#80,#22,#00,#08,#68,#14
	db #25,#04,#80,#21,#31,#04,#20,#0c
	db #19,#04,#80,#31,#3b,#08,#20,#2a
	db #00,#04,#45,#1c,#19,#04,#80,#22
	db #00,#04,#48,#14,#25,#04,#80,#31
	db #34,#08,#20,#2a,#00,#08,#6f,#1c
	db #1c,#08,#80,#31,#34,#04,#20,#2a
	db #00,#04,#4f,#1c,#1c,#04,#80,#31
	db #3b,#08,#20,#2a,#00,#08,#68,#1c
	db #28,#08,#80,#31,#34,#04,#20,#2a
	db #00,#08,#65,#1c,#28,#04,#80,#21
	db #3a,#08,#20,#0c,#28,#04,#80,#22
	db #00,#04,#4f,#14,#28,#04,#80,#31
	db #33,#08,#20,#2a,#00,#04,#4f,#1c
	db #1b,#08,#80,#02,#00,#04,#4f,#31
	db #33,#04,#20,#2a,#00,#04,#4f,#1c
	db #1b,#04,#80,#31,#3a,#08,#20,#2a
	db #00,#08,#68,#1c,#1b,#04,#80,#04
	db #27,#04,#80,#31,#33,#04,#20,#2a
	db #00,#04,#45,#1c,#1b,#04,#80,#31
	db #3b,#08,#20,#2a,#00,#04,#48,#1c
	db #1b,#04,#80,#22,#00,#08,#6f,#14
	db #27,#04,#80,#21,#32,#08,#20,#0c
	db #1a,#08,#80,#02,#00,#04,#4f,#31
	db #32,#04,#20,#2a,#00,#08,#68,#1c
	db #1a,#04,#80,#21,#3a,#08,#20,#0c
	db #26,#08,#80,#02,#00,#08,#65,#21
	db #32,#04,#20,#0c,#26,#04,#80,#31
	db #3b,#08,#20,#2a,#00,#04,#4f,#1c
	db #1a,#04,#80,#22,#00,#04,#4f,#14
	db #26,#04,#80,#31,#31,#08,#20,#2a
	db #00,#04,#4f,#1c,#19,#08,#80,#02
	db #00,#04,#4f,#31,#31,#04,#20,#2a
	db #00,#08,#68,#1c,#19,#04,#80,#21
	db #3d,#08,#20,#0c,#19,#04,#80,#22
	db #00,#04,#45,#14,#25,#04,#80,#31
	db #31,#04,#20,#2a,#00,#04,#48,#1c
	db #19,#04,#80,#31,#3b,#08,#20,#2a
	db #00,#08,#6f,#1c,#19,#04,#80,#04
	db #25,#04,#80,#31,#34,#08,#20,#2a
	db #00,#04,#4f,#1c,#1c,#08,#80,#02
	db #00,#08,#68,#21,#34,#04,#20,#0c
	db #1c,#04,#80,#31,#3b,#08,#20,#2a
	db #00,#08,#65,#1c,#28,#08,#80,#31
	db #34,#04,#20,#2a,#00,#04,#4f,#1c
	db #28,#04,#80,#31,#3a,#08,#20,#2a
	db #00,#04,#4f,#1c,#28,#04,#80,#22
	db #00,#04,#4f,#14,#28,#04,#80,#31
	db #33,#08,#20,#2a,#00,#04,#4f,#1c
	db #1b,#08,#80,#02,#00,#08,#68,#21
	db #33,#04,#20,#0c,#1b,#04,#80,#31
	db #3a,#08,#20,#2a,#00,#04,#45,#1c
	db #1b,#04,#80,#22,#00,#04,#48,#14
	db #27,#04,#80,#31,#33,#04,#20,#2a
	db #00,#08,#6f,#1c,#1b,#04,#80,#21
	db #3b,#08,#20,#0c,#1b,#04,#80,#22
	db #00,#04,#6f,#14,#27,#04,#80,#31
	db #32,#10,#20,#2a,#00,#10,#68,#1c
	db #27,#10,#80,#b0,#d5,#fb,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	jr l962a
.l9602
	dw l9000
.l9607 equ $ + 3
.l9606 equ $ + 2
.l9604
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
.l961a equ $ + 6
.l9619 equ $ + 5
.l9618 equ $ + 4
.l9616 equ $ + 2
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00
;
.play_music
.l962a
;
	ld hl,(l9602)
	ld a,h
	or l
	ret z
	ld a,(hl)
	bit 7,a
	jp nz,l96be
	and #07
	push hl
	call #bcad
	pop hl
	and #07
	ret z
	ld ix,l9606
	ld a,(hl)
	ld (ix+#00),a
	inc hl
	ld a,(hl)
	and a
	jr z,l9667
	ld b,a
	ld a,(l9618)
	add b
	push hl
	ld l,a
	ld h,#00
	add hl,hl
	ld de,l97e8
	add hl,de
	ld a,(hl)
	ld (ix+#03),a
	inc hl
	ld a,(hl)
	ld (ix+#04),a
	pop hl
	jr l966f
.l9667
	ld (ix+#03),#00
	ld (ix+#04),#00
.l966f
	inc hl
	ld c,(hl)
	ld b,#00
	push hl
	ld h,b
	ld l,b
	ld a,(l9619)
.l9679
	srl a
	jr nc,l967e
	add hl,bc
.l967e
	sla c
	or a
	jr nz,l9679
	ld (ix+#07),l
	ld (ix+#08),h
	pop hl
	inc hl
	ld a,(hl)
	and #1f
	ld (ix+#05),a
	ld a,(hl)
	inc hl
	ld (l9602),hl
	rlca
	rlca
	rlca
	and #07
	add a
	ld l,a
	ld h,#00
	ld de,l961a
	add hl,de
	ld a,(hl)
	ld (ix+#06),a
	inc hl
	xor a
	rld
	ld (ix+#01),a
	rld
	ld (ix+#02),a
	rld
	ld hl,l9606
	call #bcaa
	jp l962a
.l96be
	push hl
	rrca
	rrca
	rrca
	and #0e
	ld l,a
	ld h,#00
	ld de,l96d1
	add hl,de
	ld e,(hl)
	inc hl
	ld h,(hl)
	ld l,e
	ex (sp),hl
	ret
.l96d1
	pop hl
	sub (hl)
	and #96
	inc e
	sub a
	ld a,h
	sub a
	ccf
	sub a
	ld h,c
	sub a
	ld d,(hl)
	sub a
	ld c,e
	sub a
	ld de,#bcbc
	jr l96e9
	ld de,#bcbf
.l96e9
	ld (l9717),de
	ld a,(hl)
	and #07
	inc hl
	bit 7,(hl)
	jr z,l96f7
	set 7,a
.l96f7
	ld (l9606),a
	and #7f
	ld b,a
	ld a,(hl)
	and #7f
	push af
	inc hl
	ld a,b
	add a
	add b
	jr z,l970f
	ld c,a
	ld b,#00
	ld de,l9607
	ldir
.l970f
	ld (l9602),hl
	pop af
	ld hl,l9606
.l9717 equ $ + 1
	call #0000
	jp l962a
	ld a,(hl)
	and #07
	add a
	push hl
	ld l,a
	ld h,#00
	ld de,l961a
	add hl,de
	ex de,hl
	pop hl
	inc hl
	ld bc,#0002
	ldir
	ld (l9602),hl
	jp l962a
.l9736
	ld a,(hl)
	inc hl
	rrca
	ld de,l9616
	ret nc
	inc de
	ret
	call l9736
	ld a,(hl)
	ld (de),a
	inc hl
	ld (l9602),hl
	jp l962a
	call l9736
	ld (l9602),hl
	ex de,hl
	inc (hl)
	jp l962a
	call l9736
	ld (l9602),hl
	ex de,hl
	dec (hl)
	jp l962a
	call l9736
	ld a,(de)
	cp (hl)
	inc hl
	jr z,l9771
	inc hl
	inc hl
	ld (l9602),hl
	jp l962a
.l9771
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	add hl,de
	ld (l9602),hl
	jp l962a
	ld a,(hl)
	bit 3,a
	jr nz,l97a2
	push hl
	and #07
	add a
	ld l,a
	ld h,#00
	ld de,l9792
	add hl,de
	ld e,(hl)
	inc hl
	ld h,(hl)
	ld l,e
	ex (sp),hl
	ret
.l9792
	or (hl)
	sub a
	cp c
	sub a
	jp #cc97
	sub a
	ret c
	sub a
	ret c
	sub a
	ret c
	sub a
	rst #18
	sub a
.l97a2
	and #07
	bit 2,a
	jr z,l97aa
	or #f8
.l97aa
	inc hl
	ld (l9602),hl
	ld hl,l9618
	add (hl)
	ld (hl),a
	jp l962a
	inc hl
	jr l9771
	inc hl
	inc hl
	inc hl
	ld (l9604),hl
	dec hl
	dec hl
	jr l9771
	ld hl,(l9604)
	ld (l9602),hl
	jp l962a
	inc hl
	ld a,(hl)
	inc hl
	ld (l9602),hl
	ld (l9619),a
	jp l962a
	ld hl,#0000
	ld (l9602),hl
	ret
	inc hl
	ld (l9602),hl
	xor a
	ld (l97a2),a
.l97e8 equ $ + 1
	jp l962a
	dw #0eee,#0e18,#0d4d,#0c8e
	dw #0bda,#0b2f,#0a8f,#09f7
	dw #0968,#08e1,#0861,#07e9
	dw #0777,#070c,#06a7,#0647
	dw #05ed,#0598,#0547,#04fc
	dw #04b4,#0470,#0431,#03f4
	dw #03bc,#0386,#0353,#0324
	dw #02f6,#02cc,#02a4,#027e
	dw #025a,#0238,#0218,#01fa
	dw #01de,#01c3,#01aa,#0192
	dw #017b,#0166,#0152,#013f
	dw #012d,#011c,#010c,#00fd
	dw #00ef,#00e1,#00d5,#00c9
	dw #00be,#00b3,#00a9,#009f
	dw #0096,#008e,#0086,#007f
	dw #0077,#0071,#006a,#0064
	dw #005f,#0059,#0054,#0050
	dw #004b,#0047,#0043,#003f
	dw #003c,#0038,#0035,#0032
	dw #002f,#002d,#002a,#0028
	dw #0026,#0024,#0022,#0020
	dw #001e,#001c,#001b,#0019
	dw #0018,#0016,#0015,#0014
	dw #0013,#0012,#0011,#0010
;
.init_music	; added by Megachur
;
	call play_music
	ld hl,evt_bloc
	ld bc,#8100
	ld de,play_music
	jp #bcd7	; call play_music every CRT interrupt
evt_bloc
	db #00,#00,#00,#00,#00,#00
	db #00,#00,#00
;
.game_name
	db "Hurlements",0
.game_year
	db "1988",0
.game_publisher
	db "Ubi Soft",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
